How to set keyboard focus on a module main window in a DXL

I can't find a way to set the keyboard focus on the actual module main window, the one displaying the current object.

When using setFocus(m), module m gets the focus, but not its main window.
Instead the focus is set on the menu of module m, such that the user can't interract with the module main window until he clicks on an object in the main window, or he presses the Tab key numerous times to circle through all the toolbars and explorer window.

This seems like a simple task but I can't find any function in the DXL Reference Manual that would allow me to do this.

Anyone has an idea how to accomplish this?
phenri - Mon Mar 21 17:33:01 EDT 2011

Re: How to set keyboard focus on a module main window in a DXL
Mathias Mamsch - Tue Mar 22 05:34:40 EDT 2011

I am not sure what you mean by "Keyboard-Focus" ... You mean for example, that by "Ctrl-H" I get to edit the object heading of the current object?

Did you try:

load(moduleVersion m, true)

 


Maybe this helps, regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Re: How to set keyboard focus on a module main window in a DXL
phenri - Tue Mar 22 09:41:38 EDT 2011

Mathias Mamsch - Tue Mar 22 05:34:40 EDT 2011

I am not sure what you mean by "Keyboard-Focus" ... You mean for example, that by "Ctrl-H" I get to edit the object heading of the current object?

Did you try:

load(moduleVersion m, true)

 


Maybe this helps, regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Yes that's what I meant.
Also that the user could be changing current object by using the arrow keys, or scroll through the module using the mouse scroll wheel.

Re: How to set keyboard focus on a module main window in a DXL
phenri - Tue Mar 22 09:53:34 EDT 2011

I tried your sugestion but it doesn't work.
Also I want the module to be opened in exclusive mode.

Here's what I am doing:

save (m)
downgrade (m) // Required to create a new history session number
m = edit (fullName (m), true)
setFocus (m)

The result is that when comming back from the dxl, using the arrow keys is circling through the first toolbar buttons (Save, Print, Print Preview buttons), rather then changing the current object. That means the keyboard focus is not at the right place within the module m.

I would like to have the focus on the actual current object in the module main window rather than on the toolbar.

Any idea?

Re: How to set keyboard focus on a module main window in a DXL
llandale - Tue Mar 22 12:14:24 EDT 2011

phenri - Tue Mar 22 09:53:34 EDT 2011
I tried your sugestion but it doesn't work.
Also I want the module to be opened in exclusive mode.

Here's what I am doing:

save (m)
downgrade (m) // Required to create a new history session number
m = edit (fullName (m), true)
setFocus (m)

The result is that when comming back from the dxl, using the arrow keys is circling through the first toolbar buttons (Save, Print, Print Preview buttons), rather then changing the current object. That means the keyboard focus is not at the right place within the module m.

I would like to have the focus on the actual current object in the module main window rather than on the toolbar.

Any idea?

perhaps refresh(mod) will help.

Re: How to set keyboard focus on a module main window in a DXL
phenri - Wed Mar 23 10:51:10 EDT 2011

I tried refresh(m) but still the focus is not set on the current object. The focus remains on the toolbar.
Maybe this feature is not yet available via dxl.
There is a setFocus(m) function and a setFocus(DBM) function, but there is no setFocus(m, o) function available. Maybe if I could find the DBM value of the window containing the current object I could do a setFocus(DBM) to set the keyboard focus on the current object.

Re: How to set keyboard focus on a module main window in a DXL
Mathias Mamsch - Wed Mar 23 11:17:51 EDT 2011

phenri - Wed Mar 23 10:51:10 EDT 2011
I tried refresh(m) but still the focus is not set on the current object. The focus remains on the toolbar.
Maybe this feature is not yet available via dxl.
There is a setFocus(m) function and a setFocus(DBM) function, but there is no setFocus(m, o) function available. Maybe if I could find the DBM value of the window containing the current object I could do a setFocus(DBM) to set the keyboard focus on the current object.

I cannot reproduce the issue at all on 8.2 or 9.2.0.0. What DOORS Version are you using? Regards, Mathias

Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: How to set keyboard focus on a module main window in a DXL
phenri - Wed Mar 23 15:29:01 EDT 2011

Client version: 9.1.0.0
Build number: 91057
Build date: Sep 29 2008 12:25:55

Server version: 9.1.0.0

Re: How to set keyboard focus on a module main window in a DXL
phenri - Wed Mar 23 15:56:41 EDT 2011

The following dxl (simplified version) bring-up a dialog, do some housekeeping functions, and then exit the dialog.
Comming back from the dialog, the setFocus(m) gives the focus to the module's first toolbar rather than the modules's current object. If I don't do a setFocus(), a random window will get the focus, not necessarilly a DOORS windows.

DB SCR_POPUP
DBE scr
Module m = current

void closeDialog (DB win)
{
release win
} // closeDialog()

void Main (DB win)
{
// Housekeeping job according to the value of DBE scr
// ...
/ ...

save (m)
downgrade (m)
m = edit (fullName (m), true)
closeDialog (SCR_POPUP)
}

scr = field (SCR_POPUP, "Please specify PR#", "", 12, false)
apply (SCR_POPUP, "Save Module", Main)
close (SCR_POPUP, false, closeDialog)
block SCR_POPUP

setFocus (m)

Re: How to set keyboard focus on a module main window in a DXL
Mathias Mamsch - Wed Mar 23 17:06:37 EDT 2011

phenri - Wed Mar 23 15:56:41 EDT 2011
The following dxl (simplified version) bring-up a dialog, do some housekeeping functions, and then exit the dialog.
Comming back from the dialog, the setFocus(m) gives the focus to the module's first toolbar rather than the modules's current object. If I don't do a setFocus(), a random window will get the focus, not necessarilly a DOORS windows.

DB SCR_POPUP
DBE scr
Module m = current

void closeDialog (DB win)
{
release win
} // closeDialog()

void Main (DB win)
{
// Housekeeping job according to the value of DBE scr
// ...
/ ...

save (m)
downgrade (m)
m = edit (fullName (m), true)
closeDialog (SCR_POPUP)
}

scr = field (SCR_POPUP, "Please specify PR#", "", 12, false)
apply (SCR_POPUP, "Save Module", Main)
close (SCR_POPUP, false, closeDialog)
block SCR_POPUP

setFocus (m)

I still don't get any effects, when doing DB SCR_POPUP = create "Test" in your script below, neither on DOORS 8.2 nor on DOORS 9.2.0.0. I always land at the current Object and Ctrl-H/Ctrl-T bring me into inplace-editing mode. How do you create your dialog? Any special settings (floating, etc.) and did you parent it to the module window? Do you launch it from the current module? Is it invoked from a trigger? Can anyone else reproduce the issue? Maybe it is a DOORS 9.1 only thing??

Regards, Mathias

Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: How to set keyboard focus on a module main window in a DXL
phenri - Wed Mar 23 18:04:25 EDT 2011

Mathias Mamsch - Wed Mar 23 17:06:37 EDT 2011
I still don't get any effects, when doing DB SCR_POPUP = create "Test" in your script below, neither on DOORS 8.2 nor on DOORS 9.2.0.0. I always land at the current Object and Ctrl-H/Ctrl-T bring me into inplace-editing mode. How do you create your dialog? Any special settings (floating, etc.) and did you parent it to the module window? Do you launch it from the current module? Is it invoked from a trigger? Can anyone else reproduce the issue? Maybe it is a DOORS 9.1 only thing??

Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

I am starting this dxl from the File->Save menu, from Ctrl-S, or from the Save button of the toolbar.
I redirected the default Module Save callback to my own Save DXL, which does some extra processing before saving the module.
It is when comming back from this dxl, which among other things bring a dialog up, that the focus is on the Toolbar rather than on the current object. As you can seee it very anoying to not have the focus on the current object comming from a module save.

Maybe the problem is due to the fact that the DXL is called from the menu or the toolbar?
Still there should be a way to force the focus back on the current object no matter what.

Re: How to set keyboard focus on a module main window in a DXL
llandale - Thu Mar 24 14:04:13 EDT 2011

Mathias Mamsch - Wed Mar 23 17:06:37 EDT 2011
I still don't get any effects, when doing DB SCR_POPUP = create "Test" in your script below, neither on DOORS 8.2 nor on DOORS 9.2.0.0. I always land at the current Object and Ctrl-H/Ctrl-T bring me into inplace-editing mode. How do you create your dialog? Any special settings (floating, etc.) and did you parent it to the module window? Do you launch it from the current module? Is it invoked from a trigger? Can anyone else reproduce the issue? Maybe it is a DOORS 9.1 only thing??

Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

When you first open a module, arrow keys do NOT select new objects, then work the Icons or appear to do nothing (but are preparing to select menu items). That's what's going on here.

v9.2.0.1 I indeed replicated the effect.
<1> Click on object
<2> Notice that arrow keys go to neighbor objects
<3> open and close the dialog
<4> Arrow keys now select different icons on the task bar.
<5> Some number of TABs will put the focus back on the objects and <2> works.

I tried lots of stuff. Had a little luck with "bringToFront(m)" which worked for as while, then didn't work for a while, then indeed worked for a while; but I didn't narrow down the where's and why-for's.

Getting the same behavior with "show" instead of "block".

Sorry, don't know what to do to help this. Perhaps either don't downgrade and re-edit the module, or don't worry about using the arrow keys.

  • louie

Re: How to set keyboard focus on a module main window in a DXL
phenri - Fri Mar 25 09:00:54 EDT 2011

llandale - Thu Mar 24 14:04:13 EDT 2011
When you first open a module, arrow keys do NOT select new objects, then work the Icons or appear to do nothing (but are preparing to select menu items). That's what's going on here.

v9.2.0.1 I indeed replicated the effect.
<1> Click on object
<2> Notice that arrow keys go to neighbor objects
<3> open and close the dialog
<4> Arrow keys now select different icons on the task bar.
<5> Some number of TABs will put the focus back on the objects and <2> works.

I tried lots of stuff. Had a little luck with "bringToFront(m)" which worked for as while, then didn't work for a while, then indeed worked for a while; but I didn't narrow down the where's and why-for's.

Getting the same behavior with "show" instead of "block".

Sorry, don't know what to do to help this. Perhaps either don't downgrade and re-edit the module, or don't worry about using the arrow keys.

  • louie

I did try the bringToFront(m) earlier, but the problem is that if the module is Maximized, this command Restore it Down before bringing it back to front. I found this behavior annoying so I disregarded bringToFront(m).

In my opinion there's missing a setFocus(m, o), or at least the GotoObject(absno,m) should also set the keyboard focus on that object. I tried the GotoObject(absno,m) but even if it changes the current object the keyboard focus remains on the menu or toolbar.